/**
 * Created by wangzilong on 2017/4/11.
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    ScrollView,
    TouchableOpacity,
    TextInput,
    ListView,
    Modal,
    Platform
} from 'react-native';
var Dimensions = require('Dimensions');
const { width, height } = Dimensions.get('window');

export default class GoodsDetail extends Component{
    render(){
        var imgWidth = this.props.imgWidth;
        var imgHeight = this.props.imgHeight;
        return(
            <View style={styles.itemContainer}>
                <View>
                    <Image style={{width:imgWidth,height:imgHeight}} source={this.props.icon}/>
                </View>
                <View style={{marginLeft:10,flex:1}}>
                    <View style={[styles.itemLine,{flex:1}]}>
                        <Text style={styles.itemTitle}>{this.props.name}</Text>
                    </View>
                    <View style={{flexDirection:'row',flex:1}}>
                        <View style={[styles.itemLine,{flex:1}]}>
                            <Text style={{fontSize:10}}>库存 : {this.props.goodsNum}</Text>
                        </View>
                        <View style={[styles.itemLine,{flex:1}]}>
                            <Text style={{fontSize:10}}>{this.props.brand}</Text>
                        </View>
                    </View>
                    <View style={{flex:1}}>
                        <Text style={{color:'#F8530B',fontSize:16}}>￥{this.props.price}</Text>
                    </View>
                </View>
            </View>
        )
    }

}


const styles = StyleSheet.create({

    itemContainer:{
        flexDirection:'row',
        alignItems:'center',
        padding:5,
        backgroundColor:'#fff',
        borderBottomWidth:1,
        borderBottomColor:'#ccc'
    },
    
});